package pers.rcklos.myserver.utils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class DaoConnection {
	private Connection conn;
	private PreparedStatement ps;
	private ResultSet rs;
	private int rsInt;
	
	private DaoConnection() {}
	
	private DaoConnection(Connection conn, PreparedStatement ps, ResultSet rs, int rsInt) {
		super();
		this.conn = conn;
		this.ps = ps;
		this.rs = rs;
		this.rsInt = rsInt;
	}

	public static DaoConnectionBuilder newDaoConnectionBuilder() {
		return new DaoConnectionBuilder();
	}
	
	public static class DaoConnectionBuilder {
		private Connection conn = null;
		private PreparedStatement ps = null;
		private ResultSet rs = null;
		private int rsInt = -1;
		
		public DaoConnectionBuilder setConn(Connection conn) {
			this.conn = conn;
			return this;
		}
		public DaoConnectionBuilder setPs(PreparedStatement ps) {
			this.ps = ps;
			return this;
		}
		public DaoConnectionBuilder setRs(ResultSet rs) {
			this.rs = rs;
			return this;
		}
		public DaoConnectionBuilder setRsInt(int rsInt) {
			this.rsInt = rsInt;
			return this;
		}
		
		public DaoConnection build() {
			return new DaoConnection(conn, ps, rs, rsInt);
		}
		
	}

	public Connection getConn() {
		return conn;
	}

	public void setConn(Connection conn) {
		this.conn = conn;
	}

	public PreparedStatement getPs() {
		return ps;
	}

	public void setPs(PreparedStatement ps) {
		this.ps = ps;
	}

	public ResultSet getRs() {
		return rs;
	}

	public void setRs(ResultSet rs) {
		this.rs = rs;
	}

	public int getRsInt() {
		return rsInt;
	}

	public void setRsInt(int rsInt) {
		this.rsInt = rsInt;
	}
	
}
